package com.caoyuqi.picture.service;

import com.caoyuqi.picture.mapper.TitleUserMapper;
import com.caoyuqi.picture.model.Title;
import com.caoyuqi.picture.model.TitleUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TitleUserService {
    @Autowired
    TitleUserMapper titleUserMapper;

    public TitleUser queryByRealname(String realname)
    {
        TitleUser user = titleUserMapper.queryByRealName(realname);
        return user;
    }
    public void InsertInToUser(String realname,String username)
    {
        titleUserMapper.InsertIntoUser(realname,username);
    }
    public int MaxTitle()
    {
        int i = titleUserMapper.MaxTitleId();
        return i;
    }
    public List<Title> QueryTitleById()
    {
        return titleUserMapper.queryTitle();
    }

    public  void  getGrade(Integer grade,String username)
    {
       titleUserMapper.UpdateGrade(grade,username);
    }
    public void updatezql(String zhengquelv,String realname)
    {
        titleUserMapper.UpdateZhengquelv(zhengquelv, realname);
    }
    public List<TitleUser> queryTop2()
    {
        List<TitleUser> titleUsers = titleUserMapper.queryTop2();
        return titleUsers;
    }
    public List<TitleUser> queryTop4()
    {
        List<TitleUser> titleUsers = titleUserMapper.queryTop4();
        return titleUsers;
    }
}
